/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package InformacnaStruktura;

/**
 *
 * @author MartinaHlinková
 */
public enum Mesiac {
    JANUAR(0,"Január",31),FEBRUAR(1,"Február",28),MAREC(2,"Marec",31),
    APRIL(3,"Apríl",30),MAJ(4,"Máj",31),JUN(5,"Jún",30),
    JUL(6,"Júl",31),AUGUST(7,"August",31),SEPTEMBER(8,"September",30),
    OKTOBER(9,"Október",31),NOVEMBER(10,"November",30),DECEMBER(11,"December",31);
    private int poradie;
    private String nazov;
    private int pocetDni;
    
    private Mesiac(int poradie,String nazov,int pocetDni){
        this.poradie = poradie;
        this.nazov = nazov;
        this.pocetDni = pocetDni;
    }
    
    @Override
    public String toString(){
        return this.nazov;
    }
    
    public int getPocetDni(){
        return this.pocetDni;
    }
    
    public int getPoradieMesiaca(){
        return this.poradie;
    }
    
    public Mesiac intToMesiac(int cislo){
        switch(cislo){
            case 0: return JANUAR;
            case 1: return FEBRUAR;
            case 2: return MAREC;
            case 3: return APRIL;
            case 4: return MAJ;
            case 5: return JUN;
            case 6: return JUL;
            case 7: return AUGUST;
            case 8: return SEPTEMBER;
            case 9: return OKTOBER;
            case 10: return NOVEMBER;
            case 11: return DECEMBER;
            default: return null;
        }
    }
    
   
}
